<?php

namespace app\admin\model;

use think\Model;


class LitestorePUser extends Model
{

    

    

    // 表名
    protected $name = 'litestore_p_user';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'certify_status_text',
        'appr_status_text'
    ];
    

    
    public function getCertifyStatusList()
    {
        return ['1' => __('Certify_status 1'), '2' => __('Certify_status 2'), '3' => __('Certify_status 3')];
    }

    public function getApprStatusList()
    {
        return ['1' => __('Appr_status 1'), '2' => __('Appr_status 2'), '3' => __('Appr_status 3'), '4' => __('Appr_status 4'), '5' => __('Appr_status 5'), '6' => __('Appr_status 6'), '7' => __('Appr_status 7')];
    }


    public function getCertifyStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['certify_status']) ? $data['certify_status'] : '');
        $list = $this->getCertifyStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getApprStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['appr_status']) ? $data['appr_status'] : '');
        $list = $this->getApprStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
